package Job01;

import java.util.Random;
import java.util.Scanner;

public class QuessMachine {
    public Random random = new Random();

    public void initial(){
        Scanner input = new Scanner(System.in);
        int num01 = random.nextInt (1000);
        String[] TV = {"长虹","华为","NVIDA","PS5","XBOX"};
        String Suem = null;
        do {
            System.out.print("商品竞猜:" +TV[new Random().nextInt(TV.length)]);
            int num = input.nextInt();
            if (num > num01){
                System.out.println("太大了");
            }else if (num < num01){
                System.out.println("太小了");
            }else {
                System.out.println("猜中了");
            }
            System.out.println("你还要继续竞猜吗?[Y/N]");
            Suem = input.next();
        }while (Suem.equals("y") || Suem.equals("Y"));



    }
}
